<!DOCTYPE html>
<html class="pl-c-html" lang="en">
  <head>
    <title id="title">Pattern Lab</title>
    <meta charset="UTF-8" />
    <meta
      name="viewport"
      content="initial-scale=1, width=device-width, viewport-fit=cover"
    />
    <meta name="theme-color" content="#ababab" />
    <!-- webpackIgnore: true -->
    <link rel="stylesheet" href="styleguide/css/pattern-lab.css" media="all" />

    <!-- webpackIgnore: true -->
    <link
      rel="prefetch"
      as="image"
      href="styleguide/images/pattern-lab-logo--on-dark.svg"
    />
    <!-- webpackIgnore: true -->
    <link
      rel="prefetch"
      as="image"
      href="styleguide/images/pattern-lab-logo--on-light.svg"
    />
  </head>

  <body class="pl-c-body">
    <pl-layout></pl-layout>

    <!-- the template for the modal slider -->
    <!-- prettier-ignore -->
    <script type="text/x-handlebars-template" class="pl-js-panel-template-base">
      <include src="partials/base-template.html"/>
    </script>

    <!-- webpackIgnore: true -->
    <script src="styleguide/data/patternlab-data.js" defer></script>
    <!-- webpackIgnore: true -->
    <script src="annotations/annotations.js" defer></script>
    <!-- webpackIgnore: true -->
    <script
      src="styleguide/js/patternlab-viewer.modern.js"
      type="module"
      crossorigin
    ></script>
    <script>
      // https://gist.github.com/samthor/64b114e4a4f539915a95b91ffd340acc
      (function () {
        var check = document.createElement('script');
        if (!('noModule' in check) && 'onbeforeload' in check) {
          var support = false;
          document.addEventListener(
            'beforeload',
            function (e) {
              if (e.target === check) {
                support = true;
              } else if (!e.target.hasAttribute('nomodule') || !support) {
                return;
              }
              e.preventDefault();
            },
            true
          );
          check.type = 'module';
          check.src = '.';
          document.head.appendChild(check);
          check.remove();
        }
      })();
    </script>
    <!-- webpackIgnore: true -->
    <script
      src="styleguide/js/patternlab-viewer.js"
      defer
      nomodule
      crossorigin
    ></script>

    <script>
      // Check that service workers are registered
      // @todo: uncomment once cache-busting strategy is in place
      // if ('serviceWorker' in navigator) {
      //   // Use the window load event to keep the page load performant
      //   window.addEventListener('load', () => {
      //     navigator.serviceWorker.register('/sw.js');
      //   });
      // }
    </script>
  </body>
</html>
